package com.rs.game.player.controlers;

import com.rs.game.Entity;
import com.rs.game.WorldObject;
import com.rs.game.WorldTile;
import com.rs.game.player.Player;

public abstract class Controler {
	
	protected Player player;
	
	public final void setPlayer(Player player) {
		this.player = player;
	}
	
	public final Object[] getParameters() {
		return player.getControlerManager().getLastControlerArguments();
	}
	
	public final void setArguments(Object[] objects) {
		player.getControlerManager().setLastControlerArguments(objects);
	}
	
	public final void removeControler() {
		player.getControlerManager().removeControlerWithoutCheck();
	}
	
	public abstract void start();
	
	
	/*
	 * after the normal checks, extra checks, only called when you start trying to attack
	 */
	public boolean canAttack(Entity target) {
		return true;
	}
	
	/*
	 * hits as ice barrage and that on multi areas
	 */
	public boolean canHit(Entity entity) {
		return true;
	}
	/*
	 * processes every game ticket, usualy not used
	 */
	public void process() {
		
	}
	
	public void moved() {
		
	}
	
	public void sendInterfaces() {
		
	}
	
	/*
	 * return can use script
	 */
	public boolean useDialogueScript(Object key) {
		return true;
	}
	
	/*
	 * return can teleport
	 */
	public boolean processMagicTeleport(WorldTile toTile) {
		return true;
	}
	
	/*
	 * return can teleport
	 */
	public boolean processItemTeleport(WorldTile toTile) {
		return true;
	}
	
	/*
	 * return process normaly
	 */
	public boolean processObjectClick1(WorldObject object) {
		return true;
	}

	/*
	 * return process normaly
	 */
	public boolean processObjectClick2(WorldObject object) {
		return true;
	}
	
	/*
	 * return process normaly
	 */
	public boolean processObjectClick3(WorldObject object) {
		return true;
	}
	/*
	 * return let default death
	 */
	public boolean sendDeath() {
		return true;
	}
	
	/*
	 * return remove controler
	 */
	public boolean login() {
		return true;
	}
	
	/*
	 * return remove controler
	 */
	public boolean logout() {
		return true;
	}
	
	public void forceClose() {
	}
}
